Fix bug #10696 with crash when an empty display string is at BOB.
authorEli Zaretskii <eliz@gnu.org>
Sat, 4 Feb 2012 09:27:03 +0000 (11:27 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 4 Feb 2012 09:27:03 +0000 (11:27 +0200)
 src/keyboard.c (adjust_point_for_property): Don't position point
 before BEGV.

src/ChangeLog
src/keyboard.c

index 6d91c672f8c9ef1893767c04f283083a82c5eb47..d3fb97a01c1deb7ef58608fe94fd09ef4664ac22 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-04  Eli Zaretskii  <eliz@gnu.org>
+
+       * keyboard.c (adjust_point_for_property): Don't position point
+       before BEGV.  (Bug#10696)
+
 2012-02-03  Paul Eggert  <eggert@cs.ucla.edu>
 
        Handle overflow when computing char display width (Bug#9496).
index c92f8f3f8066b5ac52002f0fb08ba64d9f33a77b..d4ff3c58f9b54a07dff3f769f4ce5379fd81d4bd 100644 (file)
@@ -1749,7 +1749,9 @@ adjust_point_for_property (EMACS_INT last_pt, int modified)
        {
          xassert (end > PT);
          SET_PT (PT < last_pt
-                 ? (STRINGP (val) && SCHARS (val) == 0 ? beg - 1 : beg)
+                 ? (STRINGP (val) && SCHARS (val) == 0
+                    ? max (beg - 1, BEGV)
+                    : beg)
                  : end);
          check_composition = check_invisible = 1;
        }